/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.qinyeit.serviceapp.entity.enums.PaymentState;
import com.qinyeit.serviceapp.entity.enums.StoreInState;
import com.qinyeit.serviceapp.entity.enums.StoreInType;
import lombok.Builder;
import lombok.experimental.Tolerate;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

/**
 * ClassName: StoreInOrder <br/>
 * Function: 入库单据 <br/>
 * date: 2018-11-08 14:01:15 <br/>
 *
 * @author liuwenjin
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="store_in_orders")
public class StoreInOrder extends MerchantGroupBaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	// 单号 
    @Column(name="no", length = 300)
	private String no = null;

	// 供应商 
    @Column(name="supplier_id")
	private Long supplierId = null;
	// 供应商
    @Column(name="supplier_name")
	private String supplierName = null;

	// 仓库id 
    @Column(name="warehouse_id")
	private Long warehouseId = null;
	// 仓库id
    @Column(name="warehouse_name")
	private String warehouseName = null;

	// 入库日期 
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
    @Column(name="in_time")
	private Date inTime = null;

	// 单据类型 
    @Column(name="type", length = 300)
	@Enumerated(EnumType.STRING)
	private StoreInType type = null;

	// 单据金额 
    @Column(name="amount",scale=2)
	private Double amount = null;

	// 状态 
    @Column(name="state", length = 300)
	@Enumerated(EnumType.STRING)
	private StoreInState state = null;

	// 菜品库
	@Column(name="store_id", length = 300)
	private Long storeId = null;

	// 菜品库
	@Column(name="store_name", length = 300)
	private String storeName = null;

	//优惠金额
	@Column(name = "gift_amount")
	private Double giftAmount = 0d;

	//实收金额
	@Column(name = "pay_amount")
	private Double payAmount = 0d;

	//是否结清
	@Column(name = "payment_state")
	@Enumerated(EnumType.STRING)
	private PaymentState paymentState = PaymentState.NORMAL;



	// 操作人
	@Column(name="operator_name")
	private String operatorName = null;


	@Tolerate
	public StoreInOrder() {
		
	}
    @Tolerate
	public StoreInOrder(Long id){
    	super.setId(id);
    }
	
	/**
	 * 获取单号
	 */
	public String getNo() {
		return this.no;
	}

    /**
     * 设置单号
     */
	public StoreInOrder setNo(String no) {
		this.no = no;
		return this;
	}

	/**
	 * 获取供应商
	 */
	public Long getSupplierId() {
		return this.supplierId;
	}

    /**
     * 设置供应商
     */
	public StoreInOrder setSupplierId(Long supplierId) {
		this.supplierId = supplierId;
		return this;
	}

	/**
	 * 获取仓库id
	 */
	public Long getWarehouseId() {
		return this.warehouseId;
	}

    /**
     * 设置仓库id
     */
	public StoreInOrder setWarehouseId(Long warehouseId) {
		this.warehouseId = warehouseId;
		return this;
	}

	/**
	 * 获取入库日期
	 */
	public Date getInTime() {
		return this.inTime;
	}

    /**
     * 设置入库日期
     */
	public StoreInOrder setInTime(Date inTime) {
		this.inTime = inTime;
		return this;
	}


	/**
	 * 获取单据金额
	 */
	public Double getAmount() {
		return this.amount;
	}

    /**
     * 设置单据金额
     */
	public StoreInOrder setAmount(Double amount) {
		this.amount = amount;
		return this;
	}

	public StoreInType getType() {
		return type;
	}

	public void setType(StoreInType type) {
		this.type = type;
	}

	public StoreInState getState() {
		return state;
	}

	public void setState(StoreInState state) {

		this.state = state;
	}

	public String getSupplierName() {
		return supplierName;
	}

	public void setSupplierName(String supplierName) {
		this.supplierName = supplierName;
	}

	public String getWarehouseName() {
		return warehouseName;
	}

	public void setWarehouseName(String warehouseName) {
		this.warehouseName = warehouseName;
	}

	public Long getStoreId() {
		return storeId;
	}

	public void setStoreId(Long storeId) {
		this.storeId = storeId;
	}

	public String getStoreName() {
		return storeName;
	}

	public void setStoreName(String storeName) {
		this.storeName = storeName;
	}

	public Double getGiftAmount() {
		return giftAmount;
	}

	public void setGiftAmount(Double giftAmount) {
		this.giftAmount = giftAmount;
	}

	public Double getPayAmount() {
		return payAmount;
	}

	public void setPayAmount(Double payAmount) {
		this.payAmount = payAmount;
	}

	public PaymentState getPaymentState() {
		return paymentState;
	}

	public void setPaymentState(PaymentState paymentState) {
		this.paymentState = paymentState;
	}

	public String getOperatorName() {
		return operatorName;
	}

	public void setOperatorName(String operatorName) {
		this.operatorName = operatorName;
	}
}
